package com.zlz.rocketmq.service;

import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * @author: zlz
 * @date: 2021/11/10 22:20
 * @description:
 * @since: JDK1.8
 */
@Component("consumerService")
@RocketMQMessageListener(topic = "hello",consumerGroup = "${rocketmq.consumer.group}")
public class ConsumerService implements RocketMQListener<String> {

    public void onMessage(String msg) {
        System.out.println("收到消息：" + msg);
    }
}
